<?php
class News_model extends CI_Model {

	public function __construct()
	{
		$this->load->database();
	}

	public function get_news()
	{		
		$query = $this->db->get('news');
		return $query->result_array();
	}

	public function additem()
	{
		$data = array(
			'title' => $this->input->post('title'),
			'context' => $this->input->post('context'),
			'author'=> 'admin',
			'createtime' => time()
			);
		$this->db->insert('news',$data);
	}

}
